<?php
/**
 * 托福控制器基础类
 * by Obelisk
 */
namespace app\libs;
use yii;
use yii\web\Controller;
use app\models\Login;
use app\modules\cn\models\HistoryRecord;
use app\modules\basic\models\Params;
class IeltsController extends Controller {
    public $title;
    public $keywords;
    public $description;
    public $type;
    public $homeTag;
    //初始化
    //初始化
    public function init() {
        $uid = Yii::$app->session->get('uid');
        $userid = Yii::$app->session->get('userid');
        $token = isset($_COOKIE['sslToken'])?$_COOKIE['sslToken']:false;
        $tokenOut = isset($_COOKIE['sslTokenOut'])?$_COOKIE['sslTokenOut']:false;
        parent::init();
        include_once($_SERVER['DOCUMENT_ROOT'].'/../libs/ucenter/ucenter.php');
        // $uid =0;

        // $token='059fdfb4a00979db7125db0ace95310e';
        if($tokenOut){
            if($uid){
                session_destroy();
            }
        }else{
            if(!$userid){
                if($token){
                    $data = Method::webcheck($token);               
                    // var_dump($data);die;
                    if($data['code'] == 1){
                        Method::confim_user($data['info']);
                    }
                }
            }
        }
    }
}
?>

